#include<iostream>
#include<string>
#include<vector>
using namespace std;

struct ListNode {
	int val;
	ListNode *next;
	ListNode(int x) : val(x), next(NULL) {}	
};

class Solution {
public:
	void deleteNode(ListNode* node) {
		vector<int> list;
		ListNode *iter = node->next;
		while (iter) {
			list.push_back(iter->val);
			iter = iter->next;
		}
		ListNode *t = node;
		for (int i = 0; i < list.size(); i++) {
			t->val = list[i];
			if(i<list.size()-1) t = t->next;
		}
		t->next = NULL;
	}

	void deleteNodeOptimize(ListNode* node) {
		node->val = node->next->val;
		node->next = node->next->next;
	}
};

int main() {

}